var t = require("../common/index.js");

Component({
  properties: {
    data: { type: Object },
    floorIndex: { type: Number }
  },
  methods: {
    goLink: function (e) {
      console.log('imageList e', e)
      var o = e.currentTarget.dataset, a = o.item, linkType = a.linkType, n = a.data, r = o.positionIndex, p = o.timestamp, s = e.currentTarget.offsetTop;
      if (linkType) {
        var m = this.data.floorIndex;
        if(linkType == 'product'){
          (0, t.goLink)({
            type: "goods",
            data: {
              type: linkType,
              item: a
            },
            saOption: {
              componentName: "imageList",
              floorIndex: m,
              positionIndex: r,
              timestamp: p,
              offsetTop: s
            }
          });
        } else if(linkType == 'inner_url'){
          (0, t.goLink)({
            type: "page",
            data: {
              type: linkType,
              item: a
            },
            saOption: {
              componentName: "imageList",
              floorIndex: m,
              positionIndex: r,
              timestamp: p,
              offsetTop: s
            }
          });
        }
        
      }
    }
  }
});